<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const canvas = document.createElement("canvas");
        document.body.append(canvas);
        const context = canvas.getContext("2d");
        context.moveTo(0, 0)
        context.lineTo(100, 100)
        context.lineTo(200, 100)
        context.lineTo(300, 300)
        context.stroke()
    </script>
</body>

</html>